#include<bits/stdc++.h>
#define int long long
#define ls(x) ((x)*2)
#define rs(x) ((x)*2+1)
#define Debug(...) fprintf(stderr, __VA_ARGS__)
#define For(i,a,b) for(int i=a,i##end=b;i<=i##end;i++)
#define Rof(i,a,b) for(int i=a,i##end=b;i>=i##end;i--)
#define rep(i,  b) for(int i=1,i##end=b;i<=i##end;i++)
using namespace std;
const int N=1e6+5,base=999983,Mod=998244353;
//char buf[(1<<21)+5],*p1,*p2;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
inline void chmx(int &x,int y){(x<y)&&(x=y);}
inline void chmn(int &x,int y){(x>y)&&(x=y);}
inline void Add(int &x,int y){(x=x+y+Mod)%=Mod;}
inline int read(){
	int f=0,x=0;
	char ch=getchar();
	while(!isdigit(ch)){f|=(ch=='-');ch=getchar();}
	while(isdigit(ch)){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
	return f?-x:x;
}
void print(int n){
    if(n<0){
        putchar('-');
        n*=-1;
    }
    if(n>9) print(n/10);
    putchar(n%10+'0');
}
int n,m;
double f[2][505][505];
struct XXX{
	double a,b;
}z[N];
inline bool cmp(XXX x,XXX y){if(x.b==-1||y.b==-1) return x.b>y.b;return x.b<y.b;}
inline bool cmb(XXX x,XXX y){return x.a<y.a;}
double p[N];
inline double calc(int K){
	double res=0;
	For(i,1,K){
		res+=z[i].b/(i);
		p[i]=max(0.0,z[i].a-z[i].b)/(K+1);
	}
	For(i,K+1,n) p[i]=z[i].a/(K+1);
	sort(p+1,p+n+1);
	For(j,1,m) res+=p[j];
	return res;
}
signed main(){
	freopen("talk.in","r",stdin);
	freopen("talk.out","w",stdout);
	// ios::sync_with_stdio(false);
	// cin.tie(0); cout.tie(0);
	n=read(),m=read();
//		memset(f,0x3f,sizeof(f));
	For(i,1,n) z[i].a=read(),z[i].b=read();
	double ans=1000000000.0;
	sort(z+1,z+n+1,cmp); 
	if(n<=100){
	For(K,0,n){
		double res=0;
		For(j,0,m)For(t,0,n) f[0][j][t]=1000000000.0;
		f[0][0][0]=0;
		For(i,1,n){
			For(j,0,m)For(t,0,n) f[i&1][j][t]=1000000000.0;
			For(j,0,m){
				For(t,0,n){
					f[i&1][j][t]=min(f[i&1][j][t],f[(i-1)&1][j][t]);
					f[i&1][j+1][t]=min(f[i&1][j+1][t],f[(i-1)&1][j][t]+1.0*z[i].a/(K+1));
					if(z[i].b==-1){continue; }
					if(z[i].a<=z[i].b){
						f[i&1][j+1][t+1]=min(f[i&1][j+1][t+1],f[(i-1)&1][j][t]+1.0*z[i].b/(t+1));
					}
					else{
						f[i&1][j][t+1]=min(f[i&1][j][t+1],f[(i-1)&1][j][t]+1.0*z[i].b/(t+1));
						f[i&1][j+1][t+1]=min(f[i&1][j+1][t+1],f[(i-1)&1][j][t]+1.0*z[i].b/(t+1)+1.0*(z[i].a-z[i].b)/(K+1));
					}
				}
			}
		}
		ans=min(ans,f[n&1][m][K]);
	}
	printf("%.15lf\n",ans);return 0;
	}
	ans=1000000000.0;
	sort(z+1,z+n+1,cmp); 
	For(K,0,n){
		double res=0;
		sort(z+1,z+n+1,cmp); 
		For(i,1,K){
			res+=z[i].b/(i);
			p[i]=max(0.0,z[i].a-z[i].b)/(K+1);
		}
		For(i,K+1,n) p[i]=z[i].a/(K+1);
		sort(p+1,p+n+1);
		For(j,1,m) res+=p[j];
		ans=min(ans,res);
	}
	printf("%.15lf\n",ans);
#ifdef LOCAL
    Debug("\nMy Time: %.3lfms\n", (double)clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}

